package com.itheima.demo002;

public class homework004 {
    public static void main(String[] args) {
        /*作业1，两种解法
        System.out.println(getMax(3,6,9));
        System.out.println(getMax1(6, 8, 10));
    }

    public static int getMax1(int a, int b, int c) {
        if (a > b) {
            //a 大,拿着大的跟第三个数再比较
            if(a > c){
                return a;
            }else{
                return c;
            }
        }else{
            //b 大
            if(b > c){
                return b;
            }else{
                return c;
            }
        }
        }
        public static int getMax(int a, int b, int c) {
            int temp = a > b ? a : b;
            int max = temp > c ? temp : c ;
            return max;
            }
        */

        /*作业2
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个整数");
        int a = sc.nextInt();
        System.out.println("请输入第二个整数");
        int b = sc.nextInt();
        System.out.println("请输入第三个整数");
        int c = sc.nextInt();
        //获取最大值
        int max = getMax(a, b, c);
        //获取最小值
        int min = getMin(a, b, c);
        //获取中间值
        int mid = (a + b + c) - max - min;

        System.out.println(max + " " + mid + " " + min);
    }
    public static int getMax(int a, int b, int c) {
        int temp = a > b ? a : b;
        int max = temp > c ? temp : c;
        return max;
    }

    public static int getMin(int a, int b, int c) {
        int temp = a < b ? a : b;
        int min = temp < c ? temp : c;
        return min;
        */
    }
}